<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>数组的基本操作</title>
  </head>
  <body>
    <script>
      // 字面量形式
      var list1 = [1, 2, true, "str1"];
      // 构造函数声明
      var list2 = new Array(1, 2, false, "str2");
      console.log(list1, list2);
      console.log('-----------------------------------');

      // 通过索引（下标）访问元素
      console.log(list1[3]);
      // 通过length获取数组长度
      console.log(list1.length);
      
    </script>
  </body>
</html>
